<template>
  <div>
    <div style="display: flex;justify-content: end;">
      <el-form :model="conditionForm" :inline="true" class="conditionForm">
        <el-form-item label="组织代码:">
          <el-input v-model="conditionForm.organizationCode" placeholder="组织代码" clearable size="medium" />
        </el-form-item>
        <el-form-item label="物料:">
          <el-input v-model="conditionForm.materialCode" placeholder="物料" clearable size="medium" class="inputNormal" />
        </el-form-item>
        <el-form-item label="成本类型" prop="costTypeId">
          <el-select v-model="conditionForm.costTypeId" clearable placeholder="请选择活动区域">
            <el-option v-for="(item) in costType" :label="item.costType" :key="item.businessId"
              :value="`${item.businessId}`"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="onSubmit" icon="el-icon-search" size="medium">查询</el-button>
          <!-- <el-button type="text" @click="moreQuery" size="medium">更多查询</el-button> -->
        </el-form-item>
      </el-form>
    </div>

  </div>
</template>

<script lang="ts" setup async>
import { onMounted, reactive } from 'vue';
import { useCostType } from '@/hooks/useCostType';
import { getCostTypeAll } from '@/requests/api/material';
defineProps({
  accountFlag: {
    type: Boolean,
    default: false
  },
  tableType: {
    type: String,
    default: ''
  }
})
export interface ExportParams {
  organizationCode?: string;
  transactionType?: string;
  transactionProcessTime?: Array<string>;
}
const { costType, getCostT } = useCostType(getCostTypeAll)
onMounted(async () => {
  getCostT()
})
const conditionForm = reactive({
  costTypeId: "", organizationCode: "", materialCode: ""
})
const onSubmit = () => {
  emit('setCondition', conditionForm);
}

const emit = defineEmits(['setCondition', 'exportItems'])


</script>
<style lang="scss" scoped>
/**

*/
.conditionForm {
  margin-top: 10px;
}

.inputNormal {
  width: 180px;
}

.button-col-lf {
  @include button-col;
  justify-content: left;
}

.button-col-rt {
  @include button-col;
  justify-content: right;
}

.el-form-item {
  // display: flex;
  // align-items: center;
  margin-right: 10px;
}
</style>
